<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\SegmentController;
use App\Http\Controllers\Admin\BuildFormController;
use App\Http\Controllers\Admin\ApprovalTemplateController;
use App\Http\Controllers\Admin\ExcelController;
use App\Http\Controllers\Common\FileController;
use App\Http\Controllers\Admin\GridController;
use App\Http\Controllers\Admin\UserAuthController;

use App\Http\Controllers\Api\BasicDataController;
use App\Http\Controllers\Api\GridAreaController;
use App\Http\Controllers\Api\GridAssessController;
use App\Http\Controllers\Api\GridHouseController;
use App\Http\Controllers\Api\GridImgController;
use App\Http\Controllers\Api\GridPriceController;

    Route::post('/login', [AuthController::class, 'login']);//登录
    Route::get('/logout', [AuthController::class, 'logout']);//登录退出
 
    Route::group(['middleware' => ['admin.login']], function () {
        Route::get('/admin_info', [AuthController::class, 'adminInfo']);//获取登录用户信息
        Route::post('/upload', [FileController::class, 'upload']);//公共图片上传

        Route::resource('admin', Admin\AdminController::class);//管理员
        Route::resource('admin_role', Admin\AdminRoleController::class);//管理员角色
        Route::resource('user', Admin\UserController::class);//微信用户
        Route::resource('user_role', Admin\UserRoleController::class);//微信用户身份
        Route::resource('project', Admin\ProjectController::class);//项目
        Route::resource('street', Admin\StreetController::class);//街道
        Route::resource('village', Admin\VillageController::class);//村庄
        Route::resource('villager', Admin\VillagerController::class);//村民
        Route::resource('grid_group', Admin\GridGroupController::class);//网格组
        Route::resource('grid', Admin\GridController::class);//网格
        Route::resource('protocol_set', Admin\ProtocolSetController::class);//协议配置
        Route::resource('protocol', Admin\ProtocolController::class);//协议
        Route::resource('mapping_company', Admin\MappingCompanyController::class);//测绘机构
        Route::resource('assess_company', Admin\AssessCompanyController::class);//评估机构
        Route::resource('disagree_reason', Admin\DisagreeReasonController::class);//不同意拆迁理由
        Route::resource('banner', Admin\BannerController::class);//banner
        Route::resource('house_prove', Admin\HouseProveController::class);//房产证号
        Route::resource('house_type', Admin\HouseTypeController::class);//户型
        Route::resource('user_auth', Admin\UserAuthController::class);//微信角色
        Route::resource('approval_set', Admin\ApprovalSetController::class);//审批配置
        Route::resource('approval_list', Admin\ApprovalListController::class);//审批配置
        Route::resource('sign_set', Admin\SignSetController::class);//协议模板配置
        Route::resource('sign_set_type', Admin\SignSetTypeController::class);//协议模板类型配置
        Route::resource('excel_set', Admin\ExcelSetController::class);//导出表配置
        Route::resource('assess_type', Admin\AssessTypeController::class);//评估类别


        Route::resource('print', Admin\PrintController::class);//打印

        Route::get('/segment', [SegmentController::class, 'index']);//号段
        Route::get('/build_form', [BuildFormController::class, 'index']);//建筑形式
        Route::get('/approval_template', [ApprovalTemplateController::class, 'index']);//审批模板

        Route::get('/export', [ExcelController::class, 'export']);//导出
        Route::post('/load', [ExcelController::class, 'load']);//导入

        Route::post('/split_grid', [GridController::class, 'splitGrid']);//拆分网格
        Route::post('/split_protocol', [GridController::class, 'splitProtocol']);//拆分协议

        Route::get('/user_menus_list', [UserAuthController::class, 'userMenusList']);//权限菜单列表
        Route::post('/add_user_menus', [UserAuthController::class, 'addUserMenus']);//新增权限菜单列表


        Route::get('/grid_info_list', [BasicDataController::class, 'gridInfoList']);//获取基础数据-根据网格id获取网格、村民、代理人信息
        
        Route::post('/area/add_opinion', [GridAreaController::class, 'addOpinion']);//入户-录入拆迁意见
        Route::get('/area/opinion_list', [GridAreaController::class, 'opinionList']);//入户-拆迁意见回显
        Route::get('/area/id_card_list', [GridAreaController::class, 'idCardList']);//入户-录入身份证回显
        Route::post('/area/add_id_card', [GridAreaController::class, 'addIdCard']);//入户-录入身份证
        Route::get('/area/area_list', [GridAreaController::class, 'areaList']);//入户-面积确认表回显
        Route::post('/area/add_area', [GridAreaController::class, 'addArea']);//入户-录入面积确认表
        
        Route::post('/assess/add_assess', [GridAssessController::class, 'addAssess']);//评估-录入
        Route::get('/assess/assess_list', [GridAssessController::class, 'assessList']);//评估-回显
       
        Route::post('/house/add_house', [GridHouseController::class, 'addHouse']);//选择户型-录入
        Route::get('/house/house_list', [GridHouseController::class, 'houseList']);//选择户型-回显

        Route::post('/img/add_img', [GridImgController::class, 'addImg']);// 户口/房产证、土地证、其他证明/签约/腾房-录入
        Route::get('/img/img_list', [GridImgController::class, 'imgList']);// 户口/房产证、土地证、其他证明/签约/腾房-回显
        
        Route::post('/price/add_price', [GridPriceController::class, 'addPrice']);// 结算/银行/发放-录入
        Route::get('/price/price_list', [GridPriceController::class, 'priceList']);// 结算/银行/发放-回显



    });

